# -*- encoding: utf-8 -*-
"""
rep2.py
此文件对Pynoht的代码字符串进行关键字和一些符号的替换
by ShawnMerry
2023年11月12日
"""

signDic = {
    "|:|": ":",
    "<|": "(",
    "|>": ")",
    "[|": "[",
    "|]": "]",
    "^^": "\"",
    "^": "'",
    "|;|": ";",
    "|/|": "\\",
    "-!-": "!",
    "|$|": "$",
    "<-": "<",
    "->": ">",
    "'s": ".",
    "|=|": "=",
    "|!=|": "!=",
    "|==|": "==",
    "|+|": "+",
    "|-|": "-",
    "|x|": "*",
    "|./.|": "/",
    "//": "# "
}
kwDic = {
    "(in)": "in",
    "dec": "class",
    "iss": "is",
    "include": "import",
    "use": "as",
    "||in": "(in)",
    "||class": "dec",
    "||is": "iss",
    "||import": "include",
    "||as": "use"
}


def trans(string: str) -> str:
    for k, v in (signDic | kwDic).items():
        string = string.replace(k, v)
    return string


def main():
    return None


if __name__ == "__main__":
    main()
